using System;
using System.Collections.Generic;
using System.Text;

namespace Logging
{
    public class LogManager
    {

        private static LogManager INSTANCE = new LogManager();

        public static LogManager GetInstance()
        {
            return INSTANCE;
        }

        private Dictionary<string, Logger> loggers;

        protected LogManager()
        {
            loggers = new Dictionary<string, Logger>();
        }

        public bool AddLogger(Logger logger)
        {
            try
            {
                loggers.Add(logger.Name, logger);
                return true;
            }
            catch
            {
                return false;
            }
        }

        public Logger GetLogger(string name)
        {
            try
            {
                return loggers[name];
            }
            catch
            {
                return null;
            }
        }
    }
}
